<!DOCTYPE html>
<html lang="en-US">
<head>
    <meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="language" content="en" />
        <link href="./assets/ffd55088/css/bootstrap.css" rel="stylesheet">
<link href="./assets/5cf9384a/solarized_light.css" rel="stylesheet">
<link href="./assets/6c54116e/style.css" rel="stylesheet">
<script src="./assets/a44cef0f/jquery.js"></script>
<script src="./assets/ffd55088/js/bootstrap.js"></script>
<script src="./assets/8ac4e28a/jssearch.js"></script>    <title>Query, yii\sphinx\Query - Yii Framework 2.0 API Documentation</title>
</head>
<body>

<div class="wrap">
    <nav id="w12023" class="navbar-inverse navbar-fixed-top navbar" role="navigation"><div class="navbar-header"><button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#w12023-collapse"><span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span></button><a class="navbar-brand" href="./index.html">Yii Framework 2.0 API Documentation</a></div><div id="w12023-collapse" class="collapse navbar-collapse"><ul id="w12024" class="navbar-nav nav"><li><a href="./index.html">Class reference</a></li>
<li class="dropdown"><a class="dropdown-toggle" href="#" data-toggle="dropdown">Extensions <b class="caret"></b></a><ul id="w12025" class="dropdown-menu"><li><a href="./ext-apidoc-index.html" tabindex="-1">apidoc</a></li>
<li><a href="./ext-authclient-index.html" tabindex="-1">authclient</a></li>
<li><a href="./ext-bootstrap-index.html" tabindex="-1">bootstrap</a></li>
<li><a href="./ext-codeception-index.html" tabindex="-1">codeception</a></li>
<li><a href="./ext-debug-index.html" tabindex="-1">debug</a></li>
<li><a href="./ext-elasticsearch-index.html" tabindex="-1">elasticsearch</a></li>
<li><a href="./ext-faker-index.html" tabindex="-1">faker</a></li>
<li><a href="./ext-gii-index.html" tabindex="-1">gii</a></li>
<li><a href="./ext-imagine-index.html" tabindex="-1">imagine</a></li>
<li><a href="./ext-jui-index.html" tabindex="-1">jui</a></li>
<li><a href="./ext-mongodb-index.html" tabindex="-1">mongodb</a></li>
<li><a href="./ext-redis-index.html" tabindex="-1">redis</a></li>
<li><a href="./ext-smarty-index.html" tabindex="-1">smarty</a></li>
<li><a href="./ext-sphinx-index.html" tabindex="-1">sphinx</a></li>
<li><a href="./ext-swiftmailer-index.html" tabindex="-1">swiftmailer</a></li>
<li><a href="./ext-twig-index.html" tabindex="-1">twig</a></li></ul></li>
<li><a href="./guide-README.html">Guide</a></li></ul><div class="navbar-form navbar-left" role="search">
  <div class="form-group">
    <input id="searchbox" type="text" class="form-control" placeholder="Search">
  </div>
</div>
</div></nav>
    <div id="search-resultbox" style="display: none;" class="modal-content">
        <ul id="search-results">
        </ul>
    </div>

    
<div class="row">
    <div class="col-md-3">
                <div id="navigation" class="list-group"><a class="list-group-item active" href="#navigation-12021" data-toggle="collapse" data-parent="#navigation">yii\sphinx <b class="caret"></b></a><div id="navigation-12021" class="submenu panel-collapse collapse in"><a class="list-group-item" href="./yii-sphinx-activedataprovider.html">ActiveDataProvider</a>
<a class="list-group-item" href="./yii-sphinx-activefixture.html">ActiveFixture</a>
<a class="list-group-item" href="./yii-sphinx-activequery.html">ActiveQuery</a>
<a class="list-group-item" href="./yii-sphinx-activerecord.html">ActiveRecord</a>
<a class="list-group-item" href="./yii-sphinx-columnschema.html">ColumnSchema</a>
<a class="list-group-item" href="./yii-sphinx-command.html">Command</a>
<a class="list-group-item" href="./yii-sphinx-connection.html">Connection</a>
<a class="list-group-item" href="./yii-sphinx-indexschema.html">IndexSchema</a>
<a class="list-group-item active" href="./yii-sphinx-query.html">Query</a>
<a class="list-group-item" href="./yii-sphinx-querybuilder.html">QueryBuilder</a>
<a class="list-group-item" href="./yii-sphinx-schema.html">Schema</a></div>
<a class="list-group-item" href="#navigation-12022" data-toggle="collapse" data-parent="#navigation">yii\sphinx\gii\model <b class="caret"></b></a><div id="navigation-12022" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-sphinx-gii-model-generator.html">Generator</a></div></div>    </div>
    <div class="col-md-9 api-content" role="main">
        <h1>Class yii\sphinx\Query</h1>
<div class="top-nav">
    <a href="index.html">All Classes</a>
            | <a href="#properties">Properties</a>
                | <a href="#methods">Methods</a>
            </div>

<table class="summaryTable docClass table table-bordered">
    <colgroup>
        <col class="col-name" />
        <col class="col-value" />
    </colgroup>
            <tr><th>Inheritance</th><td><a href="yii-sphinx-query.html">yii\sphinx\Query</a> &raquo;
<a href="yii-db-query.html">yii\db\Query</a> &raquo;
<a href="yii-base-component.html">yii\base\Component</a> &raquo;
<a href="yii-base-object.html">yii\base\Object</a></td></tr>
                <tr><th>Implements</th><td><a href="yii-base-configurable.html">yii\base\Configurable</a>, <a href="yii-db-queryinterface.html">yii\db\QueryInterface</a></td></tr>
                    <tr><th>Uses Traits</th><td><a href="yii-db-querytrait.html">yii\db\QueryTrait</a></td></tr>
                <tr><th>Subclasses</th><td><a href="yii-sphinx-activequery.html">yii\sphinx\ActiveQuery</a></td></tr>
                        <tr><th>Available since version</th><td>2.0</td></tr>
                    <tr>
          <th>Source Code</th>
          <td><a href="https://github.com/yiisoft/yii2-sphinx/blob/master/Query.php">https://github.com/yiisoft/yii2-sphinx/blob/master/Query.php</a></td>
        </tr>
    </table>

<div class="class-description">
    <p><strong>Query represents a SELECT SQL statement.</strong></p>
    <p>Query provides a set of methods to facilitate the specification of different clauses
in a SELECT statement. These methods can be chained together.</p>
<p>By calling <a href="yii-sphinx-query.html#createCommand()-detail">createCommand()</a>, we can get a <a href="yii-sphinx-command.html">yii\sphinx\Command</a> instance which can be further
used to perform/execute the Sphinx query.</p>
<p>For example,</p>
<pre><code class="hljs php language-php"><span class="hljs-variable">$query</span> = <span class="hljs-keyword">new</span> Query();
<span class="hljs-variable">$query</span>-&gt;select(<span class="hljs-string">'id, group_id'</span>)
    -&gt;from(<span class="hljs-string">'idx_item'</span>)
    -&gt;limit(<span class="hljs-number">10</span>);
<span class="hljs-comment">// build and execute the query</span>
<span class="hljs-variable">$command</span> = <span class="hljs-variable">$query</span>-&gt;createCommand();
<span class="hljs-comment">// $command-&gt;sql returns the actual SQL</span>
<span class="hljs-variable">$rows</span> = <span class="hljs-variable">$command</span>-&gt;queryAll();
</code></pre>
<p>Since Sphinx does not store the original indexed text, the snippets for the rows in query result
should be build separately via another query. You can simplify this workflow using <a href="yii-sphinx-query.html#snippetCallback()-detail">snippetCallback()</a>.</p>
<p>Warning: even if you do not set any query limit, implicit LIMIT 0,20 is present by default!</p>

    </div>

<a id="properties"></a>

<div class="summary doc-property">
<h2>Public Properties</h2>

<p><a href="#" class="toggle">Hide inherited properties</a></p>

<table class="summary-table table table-striped table-bordered table-hover">
<colgroup>
    <col class="col-property" />
    <col class="col-type" />
    <col class="col-description" />
    <col class="col-defined" />
</colgroup>
<tr>
  <th>Property</th><th>Type</th><th>Description</th><th>Defined By</th>
</tr>
        <tr class="inherited" id="$behaviors">
        <td><a href="yii-base-component.html#$behaviors-detail">$behaviors</a></td>
        <td><a href="yii-base-behavior.html">yii\base\Behavior</a>[]</td>
        <td>List of behaviors attached to this component</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr id="$connection">
        <td><a href="yii-sphinx-query.html#$connection-detail">$connection</a></td>
        <td><a href="yii-sphinx-connection.html">yii\sphinx\Connection</a></td>
        <td>Sphinx connection instance</td>
        <td><a href="yii-sphinx-query.html">yii\sphinx\Query</a></td>
    </tr>
            <tr class="inherited" id="$distinct">
        <td><a href="yii-db-query.html#$distinct-detail">$distinct</a></td>
        <td><a href="http://www.php.net/language.types.boolean">boolean</a></td>
        <td>Whether to select distinct rows of data only.</td>
        <td><a href="yii-db-query.html">yii\db\Query</a></td>
    </tr>
            <tr id="$facets">
        <td><a href="yii-sphinx-query.html#$facets-detail">$facets</a></td>
        <td><a href="http://www.php.net/language.types.array">array</a></td>
        <td>Facet search specifications.</td>
        <td><a href="yii-sphinx-query.html">yii\sphinx\Query</a></td>
    </tr>
            <tr class="inherited" id="$from">
        <td><a href="yii-db-query.html#$from-detail">$from</a></td>
        <td><a href="http://www.php.net/language.types.array">array</a></td>
        <td>The table(s) to be selected from.</td>
        <td><a href="yii-db-query.html">yii\db\Query</a></td>
    </tr>
            <tr class="inherited" id="$groupBy">
        <td><a href="yii-db-query.html#$groupBy-detail">$groupBy</a></td>
        <td><a href="http://www.php.net/language.types.array">array</a></td>
        <td>How to group the query results.</td>
        <td><a href="yii-db-query.html">yii\db\Query</a></td>
    </tr>
            <tr class="inherited" id="$having">
        <td><a href="yii-db-query.html#$having-detail">$having</a></td>
        <td><a href="http://www.php.net/language.types.string">string</a>|<a href="http://www.php.net/language.types.array">array</a></td>
        <td>The condition to be applied in the GROUP BY clause.</td>
        <td><a href="yii-db-query.html">yii\db\Query</a></td>
    </tr>
            <tr class="inherited" id="$indexBy">
        <td><a href="yii-db-querytrait.html#$indexBy-detail">$indexBy</a></td>
        <td><a href="http://www.php.net/language.types.string">string</a>|<a href="http://www.php.net/language.types.callable">callable</a></td>
        <td>The name of the column by which the query results should be indexed by.</td>
        <td><a href="yii-db-querytrait.html">yii\db\QueryTrait</a></td>
    </tr>
            <tr class="inherited" id="$join">
        <td><a href="yii-db-query.html#$join-detail">$join</a></td>
        <td><a href="http://www.php.net/language.types.array">array</a></td>
        <td>How to join with other tables.</td>
        <td><a href="yii-db-query.html">yii\db\Query</a></td>
    </tr>
            <tr class="inherited" id="$limit">
        <td><a href="yii-db-querytrait.html#$limit-detail">$limit</a></td>
        <td><a href="http://www.php.net/language.types.integer">integer</a></td>
        <td>Maximum number of records to be returned.</td>
        <td><a href="yii-db-querytrait.html">yii\db\QueryTrait</a></td>
    </tr>
            <tr id="$match">
        <td><a href="yii-sphinx-query.html#$match-detail">$match</a></td>
        <td><a href="http://www.php.net/language.types.string">string</a>|<a href="yii-db-expression.html">yii\db\Expression</a></td>
        <td>Text, which should be searched in fulltext mode.</td>
        <td><a href="yii-sphinx-query.html">yii\sphinx\Query</a></td>
    </tr>
            <tr class="inherited" id="$offset">
        <td><a href="yii-db-querytrait.html#$offset-detail">$offset</a></td>
        <td><a href="http://www.php.net/language.types.integer">integer</a></td>
        <td>Zero-based offset from where the records are to be returned.</td>
        <td><a href="yii-db-querytrait.html">yii\db\QueryTrait</a></td>
    </tr>
            <tr id="$options">
        <td><a href="yii-sphinx-query.html#$options-detail">$options</a></td>
        <td><a href="http://www.php.net/language.types.array">array</a></td>
        <td>Per-query options in format: optionName =&gt; optionValue
They will compose OPTION clause.</td>
        <td><a href="yii-sphinx-query.html">yii\sphinx\Query</a></td>
    </tr>
            <tr class="inherited" id="$orderBy">
        <td><a href="yii-db-querytrait.html#$orderBy-detail">$orderBy</a></td>
        <td><a href="http://www.php.net/language.types.array">array</a></td>
        <td>How to sort the query results.</td>
        <td><a href="yii-db-querytrait.html">yii\db\QueryTrait</a></td>
    </tr>
            <tr class="inherited" id="$params">
        <td><a href="yii-db-query.html#$params-detail">$params</a></td>
        <td><a href="http://www.php.net/language.types.array">array</a></td>
        <td>List of query parameter values indexed by parameter placeholders.</td>
        <td><a href="yii-db-query.html">yii\db\Query</a></td>
    </tr>
            <tr class="inherited" id="$select">
        <td><a href="yii-db-query.html#$select-detail">$select</a></td>
        <td><a href="http://www.php.net/language.types.array">array</a></td>
        <td>The columns being selected.</td>
        <td><a href="yii-db-query.html">yii\db\Query</a></td>
    </tr>
            <tr class="inherited" id="$selectOption">
        <td><a href="yii-db-query.html#$selectOption-detail">$selectOption</a></td>
        <td><a href="http://www.php.net/language.types.string">string</a></td>
        <td>Additional option that should be appended to the 'SELECT' keyword.</td>
        <td><a href="yii-db-query.html">yii\db\Query</a></td>
    </tr>
            <tr id="$showMeta">
        <td><a href="yii-sphinx-query.html#$showMeta-detail">$showMeta</a></td>
        <td><a href="http://www.php.net/language.types.boolean">boolean</a>|<a href="http://www.php.net/language.types.string">string</a>|<a href="yii-db-expression.html">yii\db\Expression</a></td>
        <td>Whether to automatically perform 'SHOW META' query against main one.</td>
        <td><a href="yii-sphinx-query.html">yii\sphinx\Query</a></td>
    </tr>
            <tr id="$snippetCallback">
        <td><a href="yii-sphinx-query.html#$snippetCallback-detail">$snippetCallback</a></td>
        <td><a href="http://www.php.net/language.types.callable">callable</a></td>
        <td>PHP callback, which should be used to fetch source data for the snippets.</td>
        <td><a href="yii-sphinx-query.html">yii\sphinx\Query</a></td>
    </tr>
            <tr id="$snippetOptions">
        <td><a href="yii-sphinx-query.html#$snippetOptions-detail">$snippetOptions</a></td>
        <td><a href="http://www.php.net/language.types.array">array</a></td>
        <td>Query options for the call snippet.</td>
        <td><a href="yii-sphinx-query.html">yii\sphinx\Query</a></td>
    </tr>
            <tr class="inherited" id="$union">
        <td><a href="yii-db-query.html#$union-detail">$union</a></td>
        <td><a href="http://www.php.net/language.types.array">array</a></td>
        <td>This is used to construct the UNION clause(s) in a SQL statement.</td>
        <td><a href="yii-db-query.html">yii\db\Query</a></td>
    </tr>
            <tr class="inherited" id="$where">
        <td><a href="yii-db-querytrait.html#$where-detail">$where</a></td>
        <td><a href="http://www.php.net/language.types.string">string</a>|<a href="http://www.php.net/language.types.array">array</a></td>
        <td>Query condition.</td>
        <td><a href="yii-db-querytrait.html">yii\db\QueryTrait</a></td>
    </tr>
            <tr id="$within">
        <td><a href="yii-sphinx-query.html#$within-detail">$within</a></td>
        <td><a href="http://www.php.net/language.types.string">string</a></td>
        <td>WITHIN GROUP ORDER BY clause.</td>
        <td><a href="yii-sphinx-query.html">yii\sphinx\Query</a></td>
    </tr>
    </table>
</div>

<a id="methods"></a>

<div class="summary doc-method">
<h2>Public Methods</h2>

<p><a href="#" class="toggle">Hide inherited methods</a></p>

<table class="summary-table table table-striped table-bordered table-hover">
<colgroup>
    <col class="col-method" />
    <col class="col-description" />
    <col class="col-defined" />
</colgroup>
<tr>
  <th>Method</th><th>Description</th><th>Defined By</th>
</tr>
        <tr class="inherited" id="__call()">
        <td><a href="yii-base-component.html#__call()-detail">__call()</a></td>
        <td>Calls the named method which is not a class method.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="__clone()">
        <td><a href="yii-base-component.html#__clone()-detail">__clone()</a></td>
        <td>This method is called after the object is created by cloning an existing one.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="__construct()">
        <td><a href="yii-base-object.html#__construct()-detail">__construct()</a></td>
        <td>Constructor.</td>
        <td><a href="yii-base-object.html">yii\base\Object</a></td>
    </tr>
            <tr class="inherited" id="__get()">
        <td><a href="yii-base-component.html#__get()-detail">__get()</a></td>
        <td>Returns the value of a component property.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="__isset()">
        <td><a href="yii-base-component.html#__isset()-detail">__isset()</a></td>
        <td>Checks if a property is set, i.e. defined and not null.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="__set()">
        <td><a href="yii-base-component.html#__set()-detail">__set()</a></td>
        <td>Sets the value of a component property.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="__unset()">
        <td><a href="yii-base-component.html#__unset()-detail">__unset()</a></td>
        <td>Sets a component property to be null.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr id="addFacets()">
        <td><a href="yii-sphinx-query.html#addFacets()-detail">addFacets()</a></td>
        <td>Adds additional FACET part of the query.</td>
        <td><a href="yii-sphinx-query.html">yii\sphinx\Query</a></td>
    </tr>
            <tr class="inherited" id="addGroupBy()">
        <td><a href="yii-db-query.html#addGroupBy()-detail">addGroupBy()</a></td>
        <td>Adds additional group-by columns to the existing ones.</td>
        <td><a href="yii-db-query.html">yii\db\Query</a></td>
    </tr>
            <tr id="addOptions()">
        <td><a href="yii-sphinx-query.html#addOptions()-detail">addOptions()</a></td>
        <td>Adds additional query options.</td>
        <td><a href="yii-sphinx-query.html">yii\sphinx\Query</a></td>
    </tr>
            <tr class="inherited" id="addOrderBy()">
        <td><a href="yii-db-querytrait.html#addOrderBy()-detail">addOrderBy()</a></td>
        <td>Adds additional ORDER BY columns to the query.</td>
        <td><a href="yii-db-querytrait.html">yii\db\QueryTrait</a></td>
    </tr>
            <tr class="inherited" id="addParams()">
        <td><a href="yii-db-query.html#addParams()-detail">addParams()</a></td>
        <td>Adds additional parameters to be bound to the query.</td>
        <td><a href="yii-db-query.html">yii\db\Query</a></td>
    </tr>
            <tr class="inherited" id="addSelect()">
        <td><a href="yii-db-query.html#addSelect()-detail">addSelect()</a></td>
        <td>Add more columns to the SELECT part of the query.</td>
        <td><a href="yii-db-query.html">yii\db\Query</a></td>
    </tr>
            <tr id="addWithin()">
        <td><a href="yii-sphinx-query.html#addWithin()-detail">addWithin()</a></td>
        <td>Adds additional WITHIN GROUP ORDER BY columns to the query.</td>
        <td><a href="yii-sphinx-query.html">yii\sphinx\Query</a></td>
    </tr>
            <tr class="inherited" id="all()">
        <td><a href="yii-db-query.html#all()-detail">all()</a></td>
        <td>Executes the query and returns all results as an array.</td>
        <td><a href="yii-db-query.html">yii\db\Query</a></td>
    </tr>
            <tr class="inherited" id="andFilterCompare()">
        <td><a href="yii-db-query.html#andFilterCompare()-detail">andFilterCompare()</a></td>
        <td>Adds a filtering condition for a specific column and allow the user to choose a filter operator.</td>
        <td><a href="yii-db-query.html">yii\db\Query</a></td>
    </tr>
            <tr class="inherited" id="andFilterWhere()">
        <td><a href="yii-db-querytrait.html#andFilterWhere()-detail">andFilterWhere()</a></td>
        <td>Adds an additional WHERE condition to the existing one but ignores <a href="yii-db-querytrait.html#isEmpty()-detail">empty operands</a>.</td>
        <td><a href="yii-db-querytrait.html">yii\db\QueryTrait</a></td>
    </tr>
            <tr class="inherited" id="andHaving()">
        <td><a href="yii-db-query.html#andHaving()-detail">andHaving()</a></td>
        <td>Adds an additional HAVING condition to the existing one.</td>
        <td><a href="yii-db-query.html">yii\db\Query</a></td>
    </tr>
            <tr class="inherited" id="andWhere()">
        <td><a href="yii-db-querytrait.html#andWhere()-detail">andWhere()</a></td>
        <td>Adds an additional WHERE condition to the existing one.</td>
        <td><a href="yii-db-querytrait.html">yii\db\QueryTrait</a></td>
    </tr>
            <tr class="inherited" id="attachBehavior()">
        <td><a href="yii-base-component.html#attachBehavior()-detail">attachBehavior()</a></td>
        <td>Attaches a behavior to this component.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="attachBehaviors()">
        <td><a href="yii-base-component.html#attachBehaviors()-detail">attachBehaviors()</a></td>
        <td>Attaches a list of behaviors to the component.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="average()">
        <td><a href="yii-db-query.html#average()-detail">average()</a></td>
        <td>Returns the average of the specified column values.</td>
        <td><a href="yii-db-query.html">yii\db\Query</a></td>
    </tr>
            <tr class="inherited" id="batch()">
        <td><a href="yii-db-query.html#batch()-detail">batch()</a></td>
        <td>Starts a batch query.</td>
        <td><a href="yii-db-query.html">yii\db\Query</a></td>
    </tr>
            <tr class="inherited" id="behaviors()">
        <td><a href="yii-base-component.html#behaviors()-detail">behaviors()</a></td>
        <td>Returns a list of behaviors that this component should behave as.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
                    <tr class="inherited" id="canGetProperty()">
        <td><a href="yii-base-component.html#canGetProperty()-detail">canGetProperty()</a></td>
        <td>Returns a value indicating whether a property can be read.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="canSetProperty()">
        <td><a href="yii-base-component.html#canSetProperty()-detail">canSetProperty()</a></td>
        <td>Returns a value indicating whether a property can be set.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="className()">
        <td><a href="yii-base-object.html#className()-detail">className()</a></td>
        <td>Returns the fully qualified name of this class.</td>
        <td><a href="yii-base-object.html">yii\base\Object</a></td>
    </tr>
            <tr class="inherited" id="column()">
        <td><a href="yii-db-query.html#column()-detail">column()</a></td>
        <td>Executes the query and returns the first column of the result.</td>
        <td><a href="yii-db-query.html">yii\db\Query</a></td>
    </tr>
            <tr class="inherited" id="count()">
        <td><a href="yii-db-query.html#count()-detail">count()</a></td>
        <td>Returns the number of records.</td>
        <td><a href="yii-db-query.html">yii\db\Query</a></td>
    </tr>
            <tr id="create()">
        <td><a href="yii-sphinx-query.html#create()-detail">create()</a></td>
        <td>Creates a new Query object and copies its property values from an existing one.</td>
        <td><a href="yii-sphinx-query.html">yii\sphinx\Query</a></td>
    </tr>
            <tr id="createCommand()">
        <td><a href="yii-sphinx-query.html#createCommand()-detail">createCommand()</a></td>
        <td>Creates a Sphinx command that can be used to execute this query.</td>
        <td><a href="yii-sphinx-query.html">yii\sphinx\Query</a></td>
    </tr>
                <tr class="inherited" id="detachBehavior()">
        <td><a href="yii-base-component.html#detachBehavior()-detail">detachBehavior()</a></td>
        <td>Detaches a behavior from the component.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="detachBehaviors()">
        <td><a href="yii-base-component.html#detachBehaviors()-detail">detachBehaviors()</a></td>
        <td>Detaches all behaviors from the component.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="distinct()">
        <td><a href="yii-db-query.html#distinct()-detail">distinct()</a></td>
        <td>Sets the value indicating whether to SELECT DISTINCT or not.</td>
        <td><a href="yii-db-query.html">yii\db\Query</a></td>
    </tr>
            <tr class="inherited" id="each()">
        <td><a href="yii-db-query.html#each()-detail">each()</a></td>
        <td>Starts a batch query and retrieves data row by row.</td>
        <td><a href="yii-db-query.html">yii\db\Query</a></td>
    </tr>
            <tr class="inherited" id="ensureBehaviors()">
        <td><a href="yii-base-component.html#ensureBehaviors()-detail">ensureBehaviors()</a></td>
        <td>Makes sure that the behaviors declared in <a href="yii-base-component.html#behaviors()-detail">behaviors()</a> are attached to this component.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="exists()">
        <td><a href="yii-db-query.html#exists()-detail">exists()</a></td>
        <td>Returns a value indicating whether the query result contains any row of data.</td>
        <td><a href="yii-db-query.html">yii\db\Query</a></td>
    </tr>
            <tr id="facets()">
        <td><a href="yii-sphinx-query.html#facets()-detail">facets()</a></td>
        <td>Sets FACET part of the query.</td>
        <td><a href="yii-sphinx-query.html">yii\sphinx\Query</a></td>
    </tr>
                    <tr class="inherited" id="filterWhere()">
        <td><a href="yii-db-querytrait.html#filterWhere()-detail">filterWhere()</a></td>
        <td>Sets the WHERE part of the query but ignores <a href="yii-db-querytrait.html#isEmpty()-detail">empty operands</a>.</td>
        <td><a href="yii-db-querytrait.html">yii\db\QueryTrait</a></td>
    </tr>
            <tr class="inherited" id="from()">
        <td><a href="yii-db-query.html#from()-detail">from()</a></td>
        <td>Sets the FROM part of the query.</td>
        <td><a href="yii-db-query.html">yii\db\Query</a></td>
    </tr>
            <tr class="inherited" id="getBehavior()">
        <td><a href="yii-base-component.html#getBehavior()-detail">getBehavior()</a></td>
        <td>Returns the named behavior object.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="getBehaviors()">
        <td><a href="yii-base-component.html#getBehaviors()-detail">getBehaviors()</a></td>
        <td>Returns all behaviors attached to this component.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr id="getConnection()">
        <td><a href="yii-sphinx-query.html#getConnection()-detail">getConnection()</a></td>
        <td></td>
        <td><a href="yii-sphinx-query.html">yii\sphinx\Query</a></td>
    </tr>
            <tr class="inherited" id="groupBy()">
        <td><a href="yii-db-query.html#groupBy()-detail">groupBy()</a></td>
        <td>Sets the GROUP BY part of the query.</td>
        <td><a href="yii-db-query.html">yii\db\Query</a></td>
    </tr>
            <tr class="inherited" id="hasEventHandlers()">
        <td><a href="yii-base-component.html#hasEventHandlers()-detail">hasEventHandlers()</a></td>
        <td>Returns a value indicating whether there is any handler attached to the named event.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="hasMethod()">
        <td><a href="yii-base-component.html#hasMethod()-detail">hasMethod()</a></td>
        <td>Returns a value indicating whether a method is defined.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="hasProperty()">
        <td><a href="yii-base-component.html#hasProperty()-detail">hasProperty()</a></td>
        <td>Returns a value indicating whether a property is defined for this component.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="having()">
        <td><a href="yii-db-query.html#having()-detail">having()</a></td>
        <td>Sets the HAVING part of the query.</td>
        <td><a href="yii-db-query.html">yii\db\Query</a></td>
    </tr>
            <tr class="inherited" id="indexBy()">
        <td><a href="yii-db-querytrait.html#indexBy()-detail">indexBy()</a></td>
        <td>Sets the <a href="yii-db-querytrait.html#indexBy()-detail">indexBy()</a> property.</td>
        <td><a href="yii-db-querytrait.html">yii\db\QueryTrait</a></td>
    </tr>
            <tr class="inherited" id="init()">
        <td><a href="yii-base-object.html#init()-detail">init()</a></td>
        <td>Initializes the object.</td>
        <td><a href="yii-base-object.html">yii\base\Object</a></td>
    </tr>
            <tr id="innerJoin()">
        <td><a href="yii-sphinx-query.html#innerJoin()-detail">innerJoin()</a></td>
        <td>Appends an INNER JOIN part to the query.</td>
        <td><a href="yii-sphinx-query.html">yii\sphinx\Query</a></td>
    </tr>
                <tr id="join()">
        <td><a href="yii-sphinx-query.html#join()-detail">join()</a></td>
        <td>Appends a JOIN part to the query.</td>
        <td><a href="yii-sphinx-query.html">yii\sphinx\Query</a></td>
    </tr>
            <tr id="leftJoin()">
        <td><a href="yii-sphinx-query.html#leftJoin()-detail">leftJoin()</a></td>
        <td>Appends a LEFT OUTER JOIN part to the query.</td>
        <td><a href="yii-sphinx-query.html">yii\sphinx\Query</a></td>
    </tr>
            <tr class="inherited" id="limit()">
        <td><a href="yii-db-querytrait.html#limit()-detail">limit()</a></td>
        <td>Sets the LIMIT part of the query.</td>
        <td><a href="yii-db-querytrait.html">yii\db\QueryTrait</a></td>
    </tr>
            <tr id="match()">
        <td><a href="yii-sphinx-query.html#match()-detail">match()</a></td>
        <td>Sets the fulltext query text. This text will be composed into
MATCH operator inside the WHERE clause.</td>
        <td><a href="yii-sphinx-query.html">yii\sphinx\Query</a></td>
    </tr>
            <tr class="inherited" id="max()">
        <td><a href="yii-db-query.html#max()-detail">max()</a></td>
        <td>Returns the maximum of the specified column values.</td>
        <td><a href="yii-db-query.html">yii\db\Query</a></td>
    </tr>
            <tr class="inherited" id="min()">
        <td><a href="yii-db-query.html#min()-detail">min()</a></td>
        <td>Returns the minimum of the specified column values.</td>
        <td><a href="yii-db-query.html">yii\db\Query</a></td>
    </tr>
                <tr class="inherited" id="off()">
        <td><a href="yii-base-component.html#off()-detail">off()</a></td>
        <td>Detaches an existing event handler from this component.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="offset()">
        <td><a href="yii-db-querytrait.html#offset()-detail">offset()</a></td>
        <td>Sets the OFFSET part of the query.</td>
        <td><a href="yii-db-querytrait.html">yii\db\QueryTrait</a></td>
    </tr>
            <tr class="inherited" id="on()">
        <td><a href="yii-base-component.html#on()-detail">on()</a></td>
        <td>Attaches an event handler to an event.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr id="one()">
        <td><a href="yii-sphinx-query.html#one()-detail">one()</a></td>
        <td>Executes the query and returns a single row of result.</td>
        <td><a href="yii-sphinx-query.html">yii\sphinx\Query</a></td>
    </tr>
            <tr id="options()">
        <td><a href="yii-sphinx-query.html#options()-detail">options()</a></td>
        <td>Sets the query options.</td>
        <td><a href="yii-sphinx-query.html">yii\sphinx\Query</a></td>
    </tr>
            <tr class="inherited" id="orFilterWhere()">
        <td><a href="yii-db-querytrait.html#orFilterWhere()-detail">orFilterWhere()</a></td>
        <td>Adds an additional WHERE condition to the existing one but ignores <a href="yii-db-querytrait.html#isEmpty()-detail">empty operands</a>.</td>
        <td><a href="yii-db-querytrait.html">yii\db\QueryTrait</a></td>
    </tr>
            <tr class="inherited" id="orHaving()">
        <td><a href="yii-db-query.html#orHaving()-detail">orHaving()</a></td>
        <td>Adds an additional HAVING condition to the existing one.</td>
        <td><a href="yii-db-query.html">yii\db\Query</a></td>
    </tr>
            <tr class="inherited" id="orWhere()">
        <td><a href="yii-db-querytrait.html#orWhere()-detail">orWhere()</a></td>
        <td>Adds an additional WHERE condition to the existing one.</td>
        <td><a href="yii-db-querytrait.html">yii\db\QueryTrait</a></td>
    </tr>
            <tr class="inherited" id="orderBy()">
        <td><a href="yii-db-querytrait.html#orderBy()-detail">orderBy()</a></td>
        <td>Sets the ORDER BY part of the query.</td>
        <td><a href="yii-db-querytrait.html">yii\db\QueryTrait</a></td>
    </tr>
            <tr class="inherited" id="params()">
        <td><a href="yii-db-query.html#params()-detail">params()</a></td>
        <td>Sets the parameters to be bound to the query.</td>
        <td><a href="yii-db-query.html">yii\db\Query</a></td>
    </tr>
            <tr id="populate()">
        <td><a href="yii-sphinx-query.html#populate()-detail">populate()</a></td>
        <td>Converts the raw query results into the format as specified by this query.</td>
        <td><a href="yii-sphinx-query.html">yii\sphinx\Query</a></td>
    </tr>
            <tr class="inherited" id="prepare()">
        <td><a href="yii-db-query.html#prepare()-detail">prepare()</a></td>
        <td>Prepares for building SQL.</td>
        <td><a href="yii-db-query.html">yii\db\Query</a></td>
    </tr>
                <tr id="rightJoin()">
        <td><a href="yii-sphinx-query.html#rightJoin()-detail">rightJoin()</a></td>
        <td>Appends a RIGHT OUTER JOIN part to the query.</td>
        <td><a href="yii-sphinx-query.html">yii\sphinx\Query</a></td>
    </tr>
            <tr class="inherited" id="scalar()">
        <td><a href="yii-db-query.html#scalar()-detail">scalar()</a></td>
        <td>Returns the query result as a scalar value.</td>
        <td><a href="yii-db-query.html">yii\db\Query</a></td>
    </tr>
            <tr id="search()">
        <td><a href="yii-sphinx-query.html#search()-detail">search()</a></td>
        <td>Executes the query and returns the complete search result including e.g. hits, facets.</td>
        <td><a href="yii-sphinx-query.html">yii\sphinx\Query</a></td>
    </tr>
            <tr class="inherited" id="select()">
        <td><a href="yii-db-query.html#select()-detail">select()</a></td>
        <td>Sets the SELECT part of the query.</td>
        <td><a href="yii-db-query.html">yii\db\Query</a></td>
    </tr>
            <tr id="setConnection()">
        <td><a href="yii-sphinx-query.html#setConnection()-detail">setConnection()</a></td>
        <td></td>
        <td><a href="yii-sphinx-query.html">yii\sphinx\Query</a></td>
    </tr>
            <tr id="showMeta()">
        <td><a href="yii-sphinx-query.html#showMeta()-detail">showMeta()</a></td>
        <td>Sets whether to automatically perform 'SHOW META' for the search query.</td>
        <td><a href="yii-sphinx-query.html">yii\sphinx\Query</a></td>
    </tr>
            <tr id="snippetCallback()">
        <td><a href="yii-sphinx-query.html#snippetCallback()-detail">snippetCallback()</a></td>
        <td>Sets the PHP callback, which should be used to retrieve the source data
for the snippets building.</td>
        <td><a href="yii-sphinx-query.html">yii\sphinx\Query</a></td>
    </tr>
            <tr id="snippetOptions()">
        <td><a href="yii-sphinx-query.html#snippetOptions()-detail">snippetOptions()</a></td>
        <td>Sets the call snippets query options.</td>
        <td><a href="yii-sphinx-query.html">yii\sphinx\Query</a></td>
    </tr>
            <tr class="inherited" id="sum()">
        <td><a href="yii-db-query.html#sum()-detail">sum()</a></td>
        <td>Returns the sum of the specified column values.</td>
        <td><a href="yii-db-query.html">yii\db\Query</a></td>
    </tr>
            <tr class="inherited" id="trigger()">
        <td><a href="yii-base-component.html#trigger()-detail">trigger()</a></td>
        <td>Triggers an event.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="union()">
        <td><a href="yii-db-query.html#union()-detail">union()</a></td>
        <td>Appends a SQL statement using UNION operator.</td>
        <td><a href="yii-db-query.html">yii\db\Query</a></td>
    </tr>
            <tr class="inherited" id="where()">
        <td><a href="yii-db-querytrait.html#where()-detail">where()</a></td>
        <td>Sets the WHERE part of the query.</td>
        <td><a href="yii-db-querytrait.html">yii\db\QueryTrait</a></td>
    </tr>
            <tr id="within()">
        <td><a href="yii-sphinx-query.html#within()-detail">within()</a></td>
        <td>Sets the WITHIN GROUP ORDER BY part of the query.</td>
        <td><a href="yii-sphinx-query.html">yii\sphinx\Query</a></td>
    </tr>
    </table>
</div>

<div class="summary doc-method">
<h2>Protected Methods</h2>

<p><a href="#" class="toggle">Hide inherited methods</a></p>

<table class="summary-table table table-striped table-bordered table-hover">
<colgroup>
    <col class="col-method" />
    <col class="col-description" />
    <col class="col-defined" />
</colgroup>
<tr>
  <th>Method</th><th>Description</th><th>Defined By</th>
</tr>
                                                                                                        <tr id="callSnippets()">
        <td><a href="yii-sphinx-query.html#callSnippets()-detail">callSnippets()</a></td>
        <td>Builds a snippets from provided source data.</td>
        <td><a href="yii-sphinx-query.html">yii\sphinx\Query</a></td>
    </tr>
            <tr id="callSnippetsInternal()">
        <td><a href="yii-sphinx-query.html#callSnippetsInternal()-detail">callSnippetsInternal()</a></td>
        <td>Builds a snippets from provided source data by the given index.</td>
        <td><a href="yii-sphinx-query.html">yii\sphinx\Query</a></td>
    </tr>
                                        <tr id="defaultConnection()">
        <td><a href="yii-sphinx-query.html#defaultConnection()-detail">defaultConnection()</a></td>
        <td></td>
        <td><a href="yii-sphinx-query.html">yii\sphinx\Query</a></td>
    </tr>
                                        <tr id="fillUpSnippets()">
        <td><a href="yii-sphinx-query.html#fillUpSnippets()-detail">fillUpSnippets()</a></td>
        <td>Fills the query result rows with the snippets built from source determined by
<a href="yii-sphinx-query.html#snippetCallback()-detail">snippetCallback()</a> result.</td>
        <td><a href="yii-sphinx-query.html">yii\sphinx\Query</a></td>
    </tr>
            <tr class="inherited" id="filterCondition()">
        <td><a href="yii-db-querytrait.html#filterCondition()-detail">filterCondition()</a></td>
        <td>Removes <a href="yii-db-querytrait.html#isEmpty()-detail">empty operands</a> from the given query condition.</td>
        <td><a href="yii-db-querytrait.html">yii\db\QueryTrait</a></td>
    </tr>
                                                                <tr class="inherited" id="isEmpty()">
        <td><a href="yii-db-querytrait.html#isEmpty()-detail">isEmpty()</a></td>
        <td>Returns a value indicating whether the give value is "empty".</td>
        <td><a href="yii-db-querytrait.html">yii\db\QueryTrait</a></td>
    </tr>
                                    <tr class="inherited" id="normalizeOrderBy()">
        <td><a href="yii-db-querytrait.html#normalizeOrderBy()-detail">normalizeOrderBy()</a></td>
        <td>Normalizes format of ORDER BY data</td>
        <td><a href="yii-db-querytrait.html">yii\db\QueryTrait</a></td>
    </tr>
                                                            <tr id="queryScalar()">
        <td><a href="yii-sphinx-query.html#queryScalar()-detail">queryScalar()</a></td>
        <td>Queries a scalar value by setting <a href="yii-db-query.html#select()-detail">select()</a> first.</td>
        <td><a href="yii-sphinx-query.html">yii\sphinx\Query</a></td>
    </tr>
                                                        </table>
</div>

<a id="events"></a>

<a id="constants"></a>

<h2>Property Details</h2>

<div class="property-doc">

    <div class="detail-header h3" id="$connection-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-sphinx-query.html#$connection-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-sphinx/edit/master/Query.php" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-sphinx/blob/master/Query.php" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        $connection        <span class="detail-header-tag small">
            public                                                property
                    </span>
    </div>

    <div class="doc-description">
        <p>Sphinx connection instance</p>

            </div>

    <div class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="yii-sphinx-connection.html">yii\sphinx\Connection</a></span> <strong><a href="yii-sphinx-query.html#getConnection()-detail">getConnection</a></strong> ( )<br /><span class="signature-defs">public</span> <span class="signature-type"><a href="yii-sphinx-query.html">$this</a></span> <strong><a href="yii-sphinx-query.html#setConnection()-detail">setConnection</a></strong> ( <span style="color: #0000BB">$connection</span> )</div>


    <div class="detail-header h3" id="$facets-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-sphinx-query.html#$facets-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-sphinx/edit/master/Query.php#L118" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-sphinx/blob/master/Query.php#L118" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        $facets        <span class="detail-header-tag small">
            public                                                property
                    </span>
    </div>

    <div class="doc-description">
        <p>Facet search specifications.
For example:</p>
<pre><code class="hljs php language-php">[
    <span class="hljs-string">'group_id'</span>,
    <span class="hljs-string">'brand_id'</span> =&gt; [
        <span class="hljs-string">'order'</span> =&gt; [<span class="hljs-string">'COUNT(*)'</span> =&gt; SORT_ASC],
    ],
    <span class="hljs-string">'price'</span> =&gt; [
        <span class="hljs-string">'select'</span> =&gt; <span class="hljs-string">'INTERVAL(price,200,400,600,800) AS price'</span>,
        <span class="hljs-string">'order'</span> =&gt; [<span class="hljs-string">'FACET()'</span> =&gt; SORT_ASC],
    ],
    <span class="hljs-string">'name_in_json'</span> =&gt; [
        <span class="hljs-string">'select'</span> =&gt; [<span class="hljs-keyword">new</span> Expression(<span class="hljs-string">'json_attr.name AS name_in_json'</span>)],
    ],
]
</code></pre>
<p>You need to use <a href="yii-sphinx-query.html#search()-detail">search()</a> method in order to fetch facet results.</p>
<p>Note: if you specify custom select for the facet, ensure facet name has corresponding column inside it.</p>

            </div>

    <div class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.array">array</a></span> <a href="yii-sphinx-query.html#$facets-detail">$facets</a> <span style="color: #0000BB"></span><span style="color: #007700">=&nbsp;[]</span></div>


    <div class="detail-header h3" id="$match-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-sphinx-query.html#$match-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-sphinx/edit/master/Query.php#L56" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-sphinx/blob/master/Query.php#L56" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        $match        <span class="detail-header-tag small">
            public                                                property
                    </span>
    </div>

    <div class="doc-description">
        <p>Text, which should be searched in fulltext mode.
This value will be composed into MATCH operator inside the WHERE clause.
Note: this value will be processed by <a href="yii-sphinx-connection.html#escapeMatchValue()-detail">yii\sphinx\Connection::escapeMatchValue()</a>,
if you need to compose complex match condition use <a href="yii-db-expression.html">yii\db\Expression</a>,
see <a href="yii-sphinx-query.html#match()-detail">match()</a> for details.</p>

            </div>

    <div class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.string">string</a>|<a href="yii-db-expression.html">yii\db\Expression</a></span> <a href="yii-sphinx-query.html#$match-detail">$match</a> <span style="color: #0000BB"></span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">null</span></div>


    <div class="detail-header h3" id="$options-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-sphinx-query.html#$options-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-sphinx/edit/master/Query.php#L68" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-sphinx/blob/master/Query.php#L68" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        $options        <span class="detail-header-tag small">
            public                                                property
                    </span>
    </div>

    <div class="doc-description">
        <p>Per-query options in format: optionName =&gt; optionValue
They will compose OPTION clause. This is a Sphinx specific extension
that lets you control a number of per-query options.</p>

            </div>

    <div class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.array">array</a></span> <a href="yii-sphinx-query.html#$options-detail">$options</a> <span style="color: #0000BB"></span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">null</span></div>


    <div class="detail-header h3" id="$showMeta-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-sphinx-query.html#$showMeta-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-sphinx/edit/master/Query.php#L125" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-sphinx/blob/master/Query.php#L125" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        $showMeta        <span class="detail-header-tag small">
            public                                                property
                    </span>
    </div>

    <div class="doc-description">
        <p>Whether to automatically perform 'SHOW META' query against main one.
You may set this value to be string or <a href="yii-db-expression.html">yii\db\Expression</a> instance, in this case its value will be used
as 'LIKE' condition for 'SHOW META' statement.
You need to use <a href="yii-sphinx-query.html#search()-detail">search()</a> method in order to fetch 'meta' results.</p>

            </div>

    <div class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.boolean">boolean</a>|<a href="http://www.php.net/language.types.string">string</a>|<a href="yii-db-expression.html">yii\db\Expression</a></span> <a href="yii-sphinx-query.html#$showMeta-detail">$showMeta</a> <span style="color: #0000BB"></span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">null</span></div>


    <div class="detail-header h3" id="$snippetCallback-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-sphinx-query.html#$snippetCallback-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-sphinx/edit/master/Query.php#L89" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-sphinx/blob/master/Query.php#L89" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        $snippetCallback        <span class="detail-header-tag small">
            public                                                property
                    </span>
    </div>

    <div class="doc-description">
        <p>PHP callback, which should be used to fetch source data for the snippets.
Such callback will receive array of query result rows as an argument and must return the
array of snippet source strings in the order, which match one of incoming rows.
For example:</p>
<pre><code class="hljs php language-php"><span class="hljs-variable">$query</span> = <span class="hljs-keyword">new</span> Query();
<span class="hljs-variable">$query</span>-&gt;from(<span class="hljs-string">'idx_item'</span>)
    -&gt;match(<span class="hljs-string">'pencil'</span>)
    -&gt;snippetCallback(<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-params">(<span class="hljs-variable">$rows</span>)</span> </span>{
        <span class="hljs-variable">$result</span> = [];
        <span class="hljs-keyword">foreach</span> (<span class="hljs-variable">$rows</span> <span class="hljs-keyword">as</span> <span class="hljs-variable">$row</span>) {
            <span class="hljs-variable">$result</span>[] = file_get_contents(<span class="hljs-string">'/path/to/index/files/'</span> . <span class="hljs-variable">$row</span>[<span class="hljs-string">'id'</span>] . <span class="hljs-string">'.txt'</span>);
        }
        <span class="hljs-keyword">return</span> <span class="hljs-variable">$result</span>;
    })
    -&gt;all();
</code></pre>

            </div>

    <div class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.callable">callable</a></span> <a href="yii-sphinx-query.html#$snippetCallback-detail">$snippetCallback</a> <span style="color: #0000BB"></span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">null</span></div>


    <div class="detail-header h3" id="$snippetOptions-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-sphinx-query.html#$snippetOptions-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-sphinx/edit/master/Query.php#L93" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-sphinx/blob/master/Query.php#L93" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        $snippetOptions        <span class="detail-header-tag small">
            public                                                property
                    </span>
    </div>

    <div class="doc-description">
        <p>Query options for the call snippet.</p>

            </div>

    <div class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.array">array</a></span> <a href="yii-sphinx-query.html#$snippetOptions-detail">$snippetOptions</a> <span style="color: #0000BB"></span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">null</span></div>


    <div class="detail-header h3" id="$within-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-sphinx-query.html#$within-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-sphinx/edit/master/Query.php#L62" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-sphinx/blob/master/Query.php#L62" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        $within        <span class="detail-header-tag small">
            public                                                property
                    </span>
    </div>

    <div class="doc-description">
        <p>WITHIN GROUP ORDER BY clause. This is a Sphinx specific extension
that lets you control how the best row within a group will to be selected.
The possible value matches the <a href="yii-db-querytrait.html#orderBy()-detail">orderBy()</a> one.</p>

            </div>

    <div class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.string">string</a></span> <a href="yii-sphinx-query.html#$within-detail">$within</a> <span style="color: #0000BB"></span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">null</span></div>

</div>
<h2>Method Details</h2>

<div class="method-doc">

    <div class="detail-header h3" id="addFacets()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-sphinx-query.html#addFacets()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-sphinx/edit/master/Query.php#L398" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-sphinx/blob/master/Query.php#L398" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        addFacets()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Adds additional FACET part of the query.</strong></p>

        
            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="yii-sphinx-query.html">$this</a></span> <strong><a href="yii-sphinx-query.html#addFacets()-detail">addFacets</a></strong> ( <span style="color: #0000BB">$facets</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$facets</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>Facet specifications.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="yii-sphinx-query.html">$this</a></td>
                  <td class="param-desc-col"><p>The query object itself</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="addOptions()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-sphinx-query.html#addOptions()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-sphinx/edit/master/Query.php#L332" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-sphinx/blob/master/Query.php#L332" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        addOptions()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Adds additional query options.</strong></p>

        
        <p>See also <a href="yii-sphinx-query.html#options()-detail">options()</a>.</p>    </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="yii-sphinx-query.html">$this</a></span> <strong><a href="yii-sphinx-query.html#addOptions()-detail">addOptions</a></strong> ( <span style="color: #0000BB">$options</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$options</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>Query options in format: optionName =&gt; optionValue</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="yii-sphinx-query.html">$this</a></td>
                  <td class="param-desc-col"><p>The query object itself</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="addWithin()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-sphinx-query.html#addWithin()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-sphinx/edit/master/Query.php#L370" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-sphinx/blob/master/Query.php#L370" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        addWithin()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Adds additional WITHIN GROUP ORDER BY columns to the query.</strong></p>

        
        <p>See also <a href="yii-sphinx-query.html#within()-detail">within()</a>.</p>    </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="yii-sphinx-query.html">$this</a></span> <strong><a href="yii-sphinx-query.html#addWithin()-detail">addWithin</a></strong> ( <span style="color: #0000BB">$columns</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$columns</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a>|<a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>The columns (and the directions) to find best row within a group.
Columns can be specified in either a string (e.g. "id ASC, name DESC") or an array
(e.g. <code>['id' =&gt; Query::SORT_ASC, 'name' =&gt; Query::SORT_DESC]</code>).
The method will automatically quote the column names unless a column contains some parenthesis
(which means the column contains a DB expression).</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="yii-sphinx-query.html">$this</a></td>
                  <td class="param-desc-col"><p>The query object itself</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="callSnippets()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-sphinx-query.html#callSnippets()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-sphinx/edit/master/Query.php#L475" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-sphinx/blob/master/Query.php#L475" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        callSnippets()
        <span class="detail-header-tag small">
            protected                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Builds a snippets from provided source data.</strong></p>

        
            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">protected</span> <span class="signature-type"><a href="http://www.php.net/language.types.array">array</a></span> <strong><a href="yii-sphinx-query.html#callSnippets()-detail">callSnippets</a></strong> ( <span class="signature-type"><a href="http://www.php.net/language.types.array">array</a></span> <span style="color: #0000BB">$source</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$source</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>The source data to extract a snippet from.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>Snippets list.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">throws</th>
                  <td class="param-type-col"><a href="yii-base-invalidcallexception.html">yii\base\InvalidCallException</a></td>
                  <td class="param-desc-col"><p>in case <a href="yii-sphinx-query.html#match()-detail">match()</a> is not specified.</p>
</td>
                </tr>
                        </table>

<!--	-->

    <div class="detail-header h3" id="callSnippetsInternal()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-sphinx-query.html#callSnippetsInternal()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-sphinx/edit/master/Query.php#L487" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-sphinx/blob/master/Query.php#L487" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        callSnippetsInternal()
        <span class="detail-header-tag small">
            protected                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Builds a snippets from provided source data by the given index.</strong></p>

        
            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">protected</span> <span class="signature-type"><a href="http://www.php.net/language.types.array">array</a></span> <strong><a href="yii-sphinx-query.html#callSnippetsInternal()-detail">callSnippetsInternal</a></strong> ( <span class="signature-type"><a href="http://www.php.net/language.types.array">array</a></span> <span style="color: #0000BB">$source</span>, <span style="color: #0000BB">$from</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$source</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>The source data to extract a snippet from.</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$from</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>Name of the source index.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>Snippets list.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">throws</th>
                  <td class="param-type-col"><a href="yii-base-invalidcallexception.html">yii\base\InvalidCallException</a></td>
                  <td class="param-desc-col"><p>in case <a href="yii-sphinx-query.html#match()-detail">match()</a> is not specified.</p>
</td>
                </tr>
                        </table>

<!--	-->

    <div class="detail-header h3" id="create()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-sphinx-query.html#create()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-sphinx/edit/master/Query.php#L534" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-sphinx/blob/master/Query.php#L534" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        create()
        <span class="detail-header-tag small">
            public                        static            method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Creates a new Query object and copies its property values from an existing one.</strong></p>

        <p>The properties being copies are the ones to be used by query builders.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public static</span> <span class="signature-type"><a href="yii-sphinx-query.html">yii\sphinx\Query</a></span> <strong><a href="yii-sphinx-query.html#create()-detail">create</a></strong> ( <span style="color: #0000BB">$from</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$from</span></td>
                  <td class="param-type-col"><a href="yii-sphinx-query.html">yii\sphinx\Query</a></td>
                  <td class="param-desc-col"><p>The source query object</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="yii-sphinx-query.html">yii\sphinx\Query</a></td>
                  <td class="param-desc-col"><p>The new Query object</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="createCommand()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-sphinx-query.html#createCommand()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-sphinx/edit/master/Query.php#L170" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-sphinx/blob/master/Query.php#L170" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        createCommand()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Creates a Sphinx command that can be used to execute this query.</strong></p>

        
            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="yii-sphinx-command.html">yii\sphinx\Command</a></span> <strong><a href="yii-sphinx-query.html#createCommand()-detail">createCommand</a></strong> ( <span style="color: #0000BB">$db&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">null</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$db</span></td>
                  <td class="param-type-col"><a href="yii-sphinx-connection.html">yii\sphinx\Connection</a></td>
                  <td class="param-desc-col"><p>The Sphinx connection used to generate the SQL statement.
If this parameter is not given, the <code>sphinx</code> application component will be used.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="yii-sphinx-command.html">yii\sphinx\Command</a></td>
                  <td class="param-desc-col"><p>The created Sphinx command instance.</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="defaultConnection()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-sphinx-query.html#defaultConnection()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-sphinx/edit/master/Query.php#L159" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-sphinx/blob/master/Query.php#L159" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        defaultConnection()
        <span class="detail-header-tag small">
            protected                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong></strong></p>

        
            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">protected</span> <span class="signature-type"><a href="yii-sphinx-connection.html">yii\sphinx\Connection</a></span> <strong><a href="yii-sphinx-query.html#defaultConnection()-detail">defaultConnection</a></strong> ( )</td></tr>
                                                <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="yii-sphinx-connection.html">yii\sphinx\Connection</a></td>
                  <td class="param-desc-col"><p>Default connection value.</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="facets()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-sphinx-query.html#facets()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-sphinx/edit/master/Query.php#L387" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-sphinx/blob/master/Query.php#L387" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        facets()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Sets FACET part of the query.</strong></p>

        
            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="yii-sphinx-query.html">$this</a></span> <strong><a href="yii-sphinx-query.html#facets()-detail">facets</a></strong> ( <span style="color: #0000BB">$facets</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$facets</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>Facet specifications.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="yii-sphinx-query.html">$this</a></td>
                  <td class="param-desc-col"><p>The query object itself</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="fillUpSnippets()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-sphinx-query.html#fillUpSnippets()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-sphinx/edit/master/Query.php#L453" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-sphinx/blob/master/Query.php#L453" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        fillUpSnippets()
        <span class="detail-header-tag small">
            protected                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Fills the query result rows with the snippets built from source determined by
<a href="yii-sphinx-query.html#snippetCallback()-detail">snippetCallback()</a> result.</strong></p>

        
            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">protected</span> <span class="signature-type"><a href="http://www.php.net/language.types.array">array</a>|<a href="yii-sphinx-activerecord.html">yii\sphinx\ActiveRecord</a>[]</span> <strong><a href="yii-sphinx-query.html#fillUpSnippets()-detail">fillUpSnippets</a></strong> ( <span style="color: #0000BB">$rows</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$rows</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>Raw query result rows.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a>|<a href="yii-sphinx-activerecord.html">yii\sphinx\ActiveRecord</a>[]</td>
                  <td class="param-desc-col"><p>Query result rows with filled up snippets.</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="getConnection()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-sphinx-query.html#getConnection()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-sphinx/edit/master/Query.php#L147" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-sphinx/blob/master/Query.php#L147" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        getConnection()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong></strong></p>

        
            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="yii-sphinx-connection.html">yii\sphinx\Connection</a></span> <strong><a href="yii-sphinx-query.html#getConnection()-detail">getConnection</a></strong> ( )</td></tr>
                                                <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="yii-sphinx-connection.html">yii\sphinx\Connection</a></td>
                  <td class="param-desc-col"><p>Sphinx connection instance</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="innerJoin()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-sphinx-query.html#innerJoin()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-sphinx/edit/master/Query.php#L292" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-sphinx/blob/master/Query.php#L292" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        innerJoin()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Appends an INNER JOIN part to the query.</strong></p>

        
            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="yii-sphinx-query.html">$this</a></span> <strong><a href="yii-sphinx-query.html#innerJoin()-detail">innerJoin</a></strong> ( <span style="color: #0000BB">$table</span>, <span style="color: #0000BB">$on&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">''</span>, <span style="color: #0000BB">$params&nbsp;</span><span style="color: #007700">=&nbsp;[]</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$table</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a>|<a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>The table to be joined.</p>
<p>Use a string to represent the name of the table to be joined.
The table name can contain a schema prefix (e.g. 'public.user') and/or table alias (e.g. 'user u').
The method will automatically quote the table name unless it contains some parenthesis
(which means the table is given as a sub-query or DB expression).</p>
<p>Use an array to represent joining with a sub-query. The array must contain only one element.
The value must be a <a href="yii-sphinx-query.html">yii\sphinx\Query</a> object representing the sub-query while the corresponding key
represents the alias for the sub-query.</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$on</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a>|<a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>The join condition that should appear in the ON part.
Please refer to <a href="yii-sphinx-query.html#join()-detail">join()</a> on how to specify this parameter.</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$params</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>The parameters (name =&gt; value) to be bound to the query.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="yii-sphinx-query.html">$this</a></td>
                  <td class="param-desc-col"><p>The query object itself</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="join()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-sphinx-query.html#join()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-sphinx/edit/master/Query.php#L284" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-sphinx/blob/master/Query.php#L284" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        join()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Appends a JOIN part to the query.</strong></p>

        <p>The first parameter specifies what type of join it is.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="yii-sphinx-query.html">$this</a></span> <strong><a href="yii-sphinx-query.html#join()-detail">join</a></strong> ( <span style="color: #0000BB">$type</span>, <span style="color: #0000BB">$table</span>, <span style="color: #0000BB">$on&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">''</span>, <span style="color: #0000BB">$params&nbsp;</span><span style="color: #007700">=&nbsp;[]</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$type</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>The type of join, such as INNER JOIN, LEFT JOIN.</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$table</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a>|<a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>The table to be joined.</p>
<p>Use a string to represent the name of the table to be joined.
The table name can contain a schema prefix (e.g. 'public.user') and/or table alias (e.g. 'user u').
The method will automatically quote the table name unless it contains some parenthesis
(which means the table is given as a sub-query or DB expression).</p>
<p>Use an array to represent joining with a sub-query. The array must contain only one element.
The value must be a <a href="yii-sphinx-query.html">yii\sphinx\Query</a> object representing the sub-query while the corresponding key
represents the alias for the sub-query.</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$on</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a>|<a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>The join condition that should appear in the ON part.
Please refer to <a href="yii-db-querytrait.html#where()-detail">where()</a> on how to specify this parameter.</p>
<p>Note that the array format of <a href="yii-db-querytrait.html#where()-detail">where()</a> is designed to match columns to values instead of columns to columns, so
the following would <strong>not</strong> work as expected: <code>['post.author_id' =&gt; 'user.id']</code>, it would
match the <code>post.author_id</code> column value against the string <code>'user.id'</code>.
It is recommended to use the string syntax here which is more suited for a join:</p>
<pre><code class="hljs php language-php"><span class="hljs-string">'post.author_id = user.id'</span>
</code></pre>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$params</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>The parameters (name =&gt; value) to be bound to the query.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="yii-sphinx-query.html">$this</a></td>
                  <td class="param-desc-col"><p>The query object itself</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="leftJoin()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-sphinx-query.html#leftJoin()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-sphinx/edit/master/Query.php#L300" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-sphinx/blob/master/Query.php#L300" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        leftJoin()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Appends a LEFT OUTER JOIN part to the query.</strong></p>

        
            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="yii-sphinx-query.html">$this</a></span> <strong><a href="yii-sphinx-query.html#leftJoin()-detail">leftJoin</a></strong> ( <span style="color: #0000BB">$table</span>, <span style="color: #0000BB">$on&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">''</span>, <span style="color: #0000BB">$params&nbsp;</span><span style="color: #007700">=&nbsp;[]</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$table</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a>|<a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>The table to be joined.</p>
<p>Use a string to represent the name of the table to be joined.
The table name can contain a schema prefix (e.g. 'public.user') and/or table alias (e.g. 'user u').
The method will automatically quote the table name unless it contains some parenthesis
(which means the table is given as a sub-query or DB expression).</p>
<p>Use an array to represent joining with a sub-query. The array must contain only one element.
The value must be a <a href="yii-sphinx-query.html">yii\sphinx\Query</a> object representing the sub-query while the corresponding key
represents the alias for the sub-query.</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$on</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a>|<a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>The join condition that should appear in the ON part.
Please refer to <a href="yii-sphinx-query.html#join()-detail">join()</a> on how to specify this parameter.</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$params</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>The parameters (name =&gt; value) to be bound to the query</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="yii-sphinx-query.html">$this</a></td>
                  <td class="param-desc-col"><p>The query object itself</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="match()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-sphinx-query.html#match()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-sphinx/edit/master/Query.php#L275" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-sphinx/blob/master/Query.php#L275" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        match()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Sets the fulltext query text. This text will be composed into
MATCH operator inside the WHERE clause.</strong></p>

        <p>Note: this value will be processed by <a href="yii-sphinx-connection.html#escapeMatchValue()-detail">yii\sphinx\Connection::escapeMatchValue()</a>,
if you need to compose complex match condition use <a href="yii-db-expression.html">yii\db\Expression</a>:</p>
<pre><code class="hljs php language-php"><span class="hljs-variable">$query</span> = <span class="hljs-keyword">new</span> Query();
<span class="hljs-variable">$query</span>-&gt;from(<span class="hljs-string">'my_index'</span>)
    -&gt;match(<span class="hljs-keyword">new</span> Expression(<span class="hljs-string">':match'</span>, [<span class="hljs-string">'match'</span> =&gt; <span class="hljs-string">'@(content) '</span> . Yii::<span class="hljs-variable">$app</span>-&gt;sphinx-&gt;escapeMatchValue(<span class="hljs-variable">$matchValue</span>)]))
    -&gt;all();
</code></pre>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="yii-sphinx-query.html">$this</a></span> <strong><a href="yii-sphinx-query.html#match()-detail">match</a></strong> ( <span style="color: #0000BB">$query</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$query</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>Fulltext query text.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="yii-sphinx-query.html">$this</a></td>
                  <td class="param-desc-col"><p>The query object itself</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="one()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-sphinx-query.html#one()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-sphinx/edit/master/Query.php#L190" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-sphinx/blob/master/Query.php#L190" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        one()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Executes the query and returns a single row of result.</strong></p>

        
            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.array">array</a>|<a href="http://www.php.net/language.types.boolean">boolean</a></span> <strong><a href="yii-sphinx-query.html#one()-detail">one</a></strong> ( <span style="color: #0000BB">$db&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">null</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$db</span></td>
                  <td class="param-type-col"><a href="yii-db-connection.html">yii\db\Connection</a></td>
                  <td class="param-desc-col"><p>The database connection used to generate the SQL statement.
If this parameter is not given, the <code>db</code> application component will be used.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a>|<a href="http://www.php.net/language.types.boolean">boolean</a></td>
                  <td class="param-desc-col"><p>The first row (in terms of an array) of the query result. False is returned if the query
results in nothing.</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="options()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-sphinx-query.html#options()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-sphinx/edit/master/Query.php#L319" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-sphinx/blob/master/Query.php#L319" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        options()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Sets the query options.</strong></p>

        
        <p>See also <a href="yii-sphinx-query.html#addOptions()-detail">addOptions()</a>.</p>    </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="yii-sphinx-query.html">$this</a></span> <strong><a href="yii-sphinx-query.html#options()-detail">options</a></strong> ( <span style="color: #0000BB">$options</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$options</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>Query options in format: optionName =&gt; optionValue</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="yii-sphinx-query.html">$this</a></td>
                  <td class="param-desc-col"><p>The query object itself</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="populate()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-sphinx-query.html#populate()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-sphinx/edit/master/Query.php#L182" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-sphinx/blob/master/Query.php#L182" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        populate()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Converts the raw query results into the format as specified by this query.</strong></p>

        <p>This method is internally used to convert the data fetched from database
into the format as required by this query.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.array">array</a></span> <strong><a href="yii-sphinx-query.html#populate()-detail">populate</a></strong> ( <span style="color: #0000BB">$rows</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$rows</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>The raw query result from database</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>The converted query result</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="queryScalar()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-sphinx-query.html#queryScalar()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-sphinx/edit/master/Query.php#L503" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-sphinx/blob/master/Query.php#L503" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        queryScalar()
        <span class="detail-header-tag small">
            protected                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Queries a scalar value by setting <a href="yii-db-query.html#select()-detail">select()</a> first.</strong></p>

        <p>Restores the value of select to make this query reusable.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">protected</span> <span class="signature-type"><a href="http://www.php.net/language.types.boolean">boolean</a>|<a href="http://www.php.net/language.types.string">string</a></span> <strong><a href="yii-sphinx-query.html#queryScalar()-detail">queryScalar</a></strong> ( <span style="color: #0000BB">$selectExpression</span>, <span style="color: #0000BB">$db</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$selectExpression</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a>|<a href="yii-db-expression.html">yii\db\Expression</a></td>
                  <td class="param-desc-col"></td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$db</span></td>
                  <td class="param-type-col"><a href="yii-db-connection.html">yii\db\Connection</a>|<a href="http://www.php.net/language.types.null">null</a></td>
                  <td class="param-desc-col"></td>
                </tr>
                                                </table>

<!--	-->

    <div class="detail-header h3" id="rightJoin()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-sphinx-query.html#rightJoin()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-sphinx/edit/master/Query.php#L308" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-sphinx/blob/master/Query.php#L308" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        rightJoin()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Appends a RIGHT OUTER JOIN part to the query.</strong></p>

        
            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="yii-sphinx-query.html">$this</a></span> <strong><a href="yii-sphinx-query.html#rightJoin()-detail">rightJoin</a></strong> ( <span style="color: #0000BB">$table</span>, <span style="color: #0000BB">$on&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">''</span>, <span style="color: #0000BB">$params&nbsp;</span><span style="color: #007700">=&nbsp;[]</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$table</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a>|<a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>The table to be joined.</p>
<p>Use a string to represent the name of the table to be joined.
The table name can contain a schema prefix (e.g. 'public.user') and/or table alias (e.g. 'user u').
The method will automatically quote the table name unless it contains some parenthesis
(which means the table is given as a sub-query or DB expression).</p>
<p>Use an array to represent joining with a sub-query. The array must contain only one element.
The value must be a <a href="yii-sphinx-query.html">yii\sphinx\Query</a> object representing the sub-query while the corresponding key
represents the alias for the sub-query.</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$on</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a>|<a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>The join condition that should appear in the ON part.
Please refer to <a href="yii-sphinx-query.html#join()-detail">join()</a> on how to specify this parameter.</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$params</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>The parameters (name =&gt; value) to be bound to the query</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="yii-sphinx-query.html">$this</a></td>
                  <td class="param-desc-col"><p>The query object itself</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="search()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-sphinx-query.html#search()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-sphinx/edit/master/Query.php#L205" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-sphinx/blob/master/Query.php#L205" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        search()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Executes the query and returns the complete search result including e.g. hits, facets.</strong></p>

        
            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.array">array</a></span> <strong><a href="yii-sphinx-query.html#search()-detail">search</a></strong> ( <span style="color: #0000BB">$db&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">null</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$db</span></td>
                  <td class="param-type-col"><a href="yii-sphinx-connection.html">yii\sphinx\Connection</a></td>
                  <td class="param-desc-col"><p>The Sphinx connection used to generate the SQL statement.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>The query results.</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="setConnection()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-sphinx-query.html#setConnection()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-sphinx/edit/master/Query.php#L137" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-sphinx/blob/master/Query.php#L137" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        setConnection()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong></strong></p>

        
            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="yii-sphinx-query.html">$this</a></span> <strong><a href="yii-sphinx-query.html#setConnection()-detail">setConnection</a></strong> ( <span style="color: #0000BB">$connection</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$connection</span></td>
                  <td class="param-type-col"><a href="yii-sphinx-connection.html">yii\sphinx\Connection</a></td>
                  <td class="param-desc-col"><p>Sphinx connection instance</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="yii-sphinx-query.html">$this</a></td>
                  <td class="param-desc-col"><p>The query object itself</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="showMeta()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-sphinx-query.html#showMeta()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-sphinx/edit/master/Query.php#L414" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-sphinx/blob/master/Query.php#L414" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        showMeta()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Sets whether to automatically perform 'SHOW META' for the search query.</strong></p>

        
        <p>See also <a href="yii-sphinx-query.html#showMeta()-detail">showMeta()</a>.</p>    </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="yii-sphinx-query.html">$this</a></span> <strong><a href="yii-sphinx-query.html#showMeta()-detail">showMeta</a></strong> ( <span style="color: #0000BB">$showMeta</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$showMeta</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.boolean">boolean</a>|<a href="http://www.php.net/language.types.string">string</a>|<a href="yii-db-expression.html">yii\db\Expression</a></td>
                  <td class="param-desc-col"><p>Whether to automatically perform 'SHOW META'</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="yii-sphinx-query.html">$this</a></td>
                  <td class="param-desc-col"><p>The query object itself</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="snippetCallback()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-sphinx-query.html#snippetCallback()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-sphinx/edit/master/Query.php#L427" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-sphinx/blob/master/Query.php#L427" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        snippetCallback()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Sets the PHP callback, which should be used to retrieve the source data
for the snippets building.</strong></p>

        
        <p>See also <a href="yii-sphinx-query.html#snippetCallback()-detail">snippetCallback()</a>.</p>    </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="yii-sphinx-query.html">$this</a></span> <strong><a href="yii-sphinx-query.html#snippetCallback()-detail">snippetCallback</a></strong> ( <span style="color: #0000BB">$callback</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$callback</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.callable">callable</a></td>
                  <td class="param-desc-col"><p>PHP callback, which should be used to fetch source data for the snippets.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="yii-sphinx-query.html">$this</a></td>
                  <td class="param-desc-col"><p>The query object itself</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="snippetOptions()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-sphinx-query.html#snippetOptions()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-sphinx/edit/master/Query.php#L440" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-sphinx/blob/master/Query.php#L440" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        snippetOptions()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Sets the call snippets query options.</strong></p>

        
        <p>See also <a href="yii-sphinx-query.html#snippetCallback()-detail">snippetCallback()</a>.</p>    </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="yii-sphinx-query.html">$this</a></span> <strong><a href="yii-sphinx-query.html#snippetOptions()-detail">snippetOptions</a></strong> ( <span style="color: #0000BB">$options</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$options</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>Call snippet options in format: option_name =&gt; option_value</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="yii-sphinx-query.html">$this</a></td>
                  <td class="param-desc-col"><p>The query object itself</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="within()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-sphinx-query.html#within()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-sphinx/edit/master/Query.php#L353" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-sphinx/blob/master/Query.php#L353" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        within()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Sets the WITHIN GROUP ORDER BY part of the query.</strong></p>

        
        <p>See also <a href="yii-sphinx-query.html#addWithin()-detail">addWithin()</a>.</p>    </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="yii-sphinx-query.html">$this</a></span> <strong><a href="yii-sphinx-query.html#within()-detail">within</a></strong> ( <span style="color: #0000BB">$columns</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$columns</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a>|<a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>The columns (and the directions) to find best row within a group.
Columns can be specified in either a string (e.g. "id ASC, name DESC") or an array
(e.g. <code>['id' =&gt; Query::SORT_ASC, 'name' =&gt; Query::SORT_DESC]</code>).
The method will automatically quote the column names unless a column contains some parenthesis
(which means the column contains a DB expression).</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="yii-sphinx-query.html">$this</a></td>
                  <td class="param-desc-col"><p>The query object itself</p>
</td>
                </tr>
                                    </table>

<!--	-->
</div>
        </div>
</div>

<script type="text/javascript">
    /*<![CDATA[*/
    $("a.toggle").on('click', function () {
        var $this = $(this);
        if ($this.hasClass('properties-hidden')) {
            $this.text($this.text().replace(/Show/,'Hide'));
            $this.parents(".summary").find(".inherited").show();
            $this.removeClass('properties-hidden');
        } else {
            $this.text($this.text().replace(/Hide/,'Show'));
            $this.parents(".summary").find(".inherited").hide();
            $this.addClass('properties-hidden');
        }

        return false;
    });
    /*
     $(".sourceCode a.show").toggle(function () {
     $(this).text($(this).text().replace(/show/,'hide'));
     $(this).parents(".sourceCode").find("div.code").show();
     },function () {
     $(this).text($(this).text().replace(/hide/,'show'));
     $(this).parents(".sourceCode").find("div.code").hide();
     });
     $("a.sourceLink").click(function () {
     $(this).attr('target','_blank');
     });
     */
    /*]]>*/
</script>


</div>

<footer class="footer">
        <p class="pull-right"><small>Page generated on Sat, 09 Jul 2016 12:15:58 +0000</small></p>
    Powered by <a href="http://www.yiiframework.com/" rel="external">Yii Framework</a></footer>

<script type="text/javascript">jQuery(document).ready(function () {
    var shiftWindow = function () { scrollBy(0, -50) };
    if (location.hash) setTimeout(shiftWindow, 1);
    window.addEventListener("hashchange", shiftWindow);
var element = document.createElement("script");
element.src = "./jssearch.index.js";
document.body.appendChild(element);

var searchBox = $('#searchbox');

// search when typing in search field
searchBox.on("keyup", function(event) {
    var query = $(this).val();

    if (query == '' || event.which == 27) {
        $('#search-resultbox').hide();
        return;
    } else if (event.which == 13) {
        var selectedLink = $('#search-resultbox a.selected');
        if (selectedLink.length != 0) {
            document.location = selectedLink.attr('href');
            return;
        }
    } else if (event.which == 38 || event.which == 40) {
        $('#search-resultbox').show();

        var selected = $('#search-resultbox a.selected');
        if (selected.length == 0) {
            $('#search-results').find('a').first().addClass('selected');
        } else {
            var next;
            if (event.which == 40) {
                next = selected.parent().next().find('a').first();
            } else {
                next = selected.parent().prev().find('a').first();
            }
            if (next.length != 0) {
                var resultbox = $('#search-results');
                var position = next.position();

//              TODO scrolling is buggy and jumps around
//                resultbox.scrollTop(Math.floor(position.top));
//                console.log(position.top);

                selected.removeClass('selected');
                next.addClass('selected');
            }
        }

        return;
    }
    $('#search-resultbox').show();
    $('#search-results').html('<li><span class="no-results">No results</span></li>');

    var result = jssearch.search(query);

    if (result.length > 0) {
        var i = 0;
        var resHtml = '';

        for (var key in result) {
            if (i++ > 20) {
                break;
            }
            resHtml = resHtml +
            '<li><a href="' + result[key].file.u.substr(3) +'"><span class="title">' + result[key].file.t + '</span>' +
            '<span class="description">' + result[key].file.d + '</span></a></li>';
        }
        $('#search-results').html(resHtml);
    }
});

// hide the search results on ESC
$(document).on("keyup", function(event) { if (event.which == 27) { $('#search-resultbox').hide(); } });
// hide search results on click to document
$(document).bind('click', function (e) { $('#search-resultbox').hide(); });
// except the following:
searchBox.bind('click', function(e) { e.stopPropagation(); });
$('#search-resultbox').bind('click', function(e) { e.stopPropagation(); });

});</script></body>
</html>
